import socket


def test():
    client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    client.connect(('127.0.0.1', 8090))

    while True:
        mes = input("请输入:")
        client.sendall(mes.encode('UTF-8'))
        recv = client.recv(1024)
        print(recv.decode('UTF-8'))

    client.close()


if __name__ == '__main__':
    test()